package synchonized;

public class Main {
    public static void main(String[] args) {

        SynchronizedDemo1 synchronizedDemo1 = new SynchronizedDemo1();
        SynchronizedDemo1 synchronizedDemo2 = new SynchronizedDemo1();
        new Thread(synchronizedDemo1).start();
        new Thread(synchronizedDemo2).start();
        try {
            Thread.sleep(2000);
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(synchronizedDemo1.num);
    }
}
